package com.echat.serviceapigateway.security.schedule;

import com.echat.serviceapigateway.security.service.TokenGetLimiService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by chenmohan on 2018/09/26
 *
 * @description
 */
@Component
@Log4j2
public class Jobs {

    @Autowired
    TokenGetLimiService tokenGetLimiService;

    /**
     * 每天零点刷新用户的token获取次数限制
     */
    @Scheduled(cron = "0 0 0 * * ?")
    public void refreshTokenGetLimit() {
        log.error(" refreshTokenGetLimit! ");
        tokenGetLimiService.refreshTokenGetLimit();
    }

}
